feat(copilot): support --integration-options="--skills" for skills-based scaffolding#2324
feat(copilot): support --integration-options="--skills" for skills-based scaffolding#2324
--integration-options="--skills" for skills-based scaffolding#2324Conversation
Add --skills integration option to CopilotIntegration that scaffolds commands as speckit-<name>/SKILL.md under .github/skills/ instead of the default .agent.md + .prompt.md layout. - Add options() with --skills flag (default=False) - Branch setup() between default and skills modes - Add post_process_skill_content() for Copilot-specific mode: field - Adjust build_command_invocation() for skills mode (/speckit-<stem>) - Update dispatch_command() with skills mode detection - Parse --integration-options during init command - Add 22 new skills-mode tests - All 15 existing default-mode tests continue to pass Agent-Logs-Url: https://github.com/github/spec-kit/sessions/a4903fab-64ff-46c3-8eb8-a47f495a70c0 Co-authored-by: mnriem <15701806+mnriem@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/spec-kit/sessions/a4903fab-64ff-46c3-8eb8-a47f495a70c0 Co-authored-by: mnriem <15701806+mnriem@users.noreply.github.com>
--integration-options="--skills" for skills-based scaffolding
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a Copilot integration “skills mode” (--integration-options="--skills") that scaffolds speckit-<name>/SKILL.md under .github/skills/ (instead of .agent.md + .prompt.md + VS Code settings merge), along with CLI plumbing and tests.
Changes:
- Introduces
--skillsintegration option for Copilot and branchessetup()into default vs skills scaffolding. - Extends
initto parse and forward--integration-optionsinto integrationparsed_options, and persistsai_skillswhen an integration is operating in skills mode. - Adds a new test suite covering Copilot skills-mode scaffolding, post-processing, install/uninstall, and CLI integration.
Show a summary per file
| File | Description |
|---|---|
| tests/integrations/test_integration_copilot.py | Adds comprehensive tests for Copilot --skills mode behavior and CLI wiring. |
| src/specify_cli/integrations/copilot/init.py | Implements Copilot skills-mode scaffolding via a delegate SkillsIntegration helper and adds SKILL.md post-processing + dispatch changes. |
| src/specify_cli/init.py | Ensures init parses --integration-options and persists ai_skills for integrations operating in skills mode. |
| AGENTS.md | Documents Copilot’s new skills mode and how to enable it. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/4 changed files
- Comments generated: 4
- Reset _skills_mode at start of setup() to prevent singleton state leak - Tighten skills auto-detection to require speckit-*/SKILL.md (not any non-empty .github/skills/ directory) - Add copilot_skill_mode to init next-steps so skills mode renders /speckit-plan instead of /speckit.plan - Fix docstring quoting to match actual unquoted output - Add 4 tests covering singleton reset, auto-detection false positive, speckit layout detection, and next-steps skill syntax - Fix skipped test_invalid_metadata_error_returns_unknown by simulating InvalidMetadataError on Python versions that lack it
There was a problem hiding this comment.
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/5 changed files
- Comments generated: 2
build_command_invocation() reads self._skills_mode which stays False when skills mode is only auto-detected from the project layout. Inline the /speckit-<stem> prompt construction so dispatch_command() sends the correct prompt regardless of how skills mode was detected. Also strengthen test_dispatch_detects_speckit_skills_layout to assert the -p prompt contains /speckit-plan and the user args.
There was a problem hiding this comment.
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/5 changed files
- Comments generated: 1
| parsed_options = parsed_options or {} | ||
| self._skills_mode = bool(parsed_options.get("skills")) | ||
| if self._skills_mode: | ||
| return self._setup_skills(project_root, manifest, parsed_options, **opts) | ||
| return self._setup_default(project_root, manifest, parsed_options, **opts) |
There was a problem hiding this comment.
setup() currently decides skills vs default mode solely from parsed_options.get("skills"). If a project is already in skills layout (e.g. .github/skills/speckit-*/SKILL.md exists) and the user reruns integration install copilot / setup() without --integration-options "--skills", this will scaffold the default .github/agents + .github/prompts artifacts as well, contradicting the “modes are mutually exclusive” contract and leaving the project in a mixed state. Consider treating skills as tri-state (explicitly True/False vs unspecified): when unspecified, auto-detect existing layout and stick to it (or raise a clear error if both layouts are present), and when explicitly set, error out if conflicting artifacts from the other mode already exist unless the user uninstalls/cleans first.
Adds a
--skillsflag to the Copilot integration enablingspeckit-<name>/SKILL.mdscaffolding under.github/skills/as an alternative to the default.agent.md+.prompt.md+ settings merge layout. The two modes are mutually exclusive.Implementation
_CopilotSkillsHelper(SkillsIntegration)with.github/skills/config is used as a delegate —CopilotIntegrationstays onIntegrationBasesetup()branches into_setup_default()and_setup_skills()based onparsed_options["skills"]post_process_skill_content()injectsmode: speckit.<stem>into SKILL.md frontmatter (Copilot-specific field, analogous to Claude'suser-invocable/disable-model-invocation)build_command_invocation()returns/speckit-<stem>in skills mode, bare args in default modedispatch_command()detects skills mode from_skills_modeflag or.github/skills/presence on diskCLI plumbing
initnow parses--integration-optionsvia_parse_integration_options()and merges intointegration_parsed_options(previously onlyintegration_install/integration_switchdid this)ai_skillsininit-options.jsonis set when_skills_modeis active, so downstream tools (presets, extensions) emit SKILL.md overrides correctlyTests
22 new tests in
TestCopilotSkillsModecovering: directory structure, no.prompt.md/.vscode/settings.jsonin skills mode, frontmatter structure withmode:field,post_process_skill_content()idempotency, manifest tracking, install/uninstall roundtrip,build_command_invocation()in both modes, full CLI integration, and complete file inventory. All 15 existing default-mode tests unchanged.